package com.atguigu.gmall.activity.controller;

import com.atguigu.gmall.activity.service.ActivityService;
import com.atguigu.gmall.product.client.model.activity.SeckillGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/activity/seckill")
public class ActivityApiController {

    @Autowired
    private ActivityService activityService;


    //查询秒杀数据
    @GetMapping("/findAll")
    public List<SeckillGoods> findAll(){

        return activityService.findAll();
    }

    //查询一个秒杀数据
    @GetMapping("/findBySkuId/{skuId}")
    public SeckillGoods findBySkuId(@PathVariable Long skuId){

        return activityService.findBySkuId(skuId);
    }

}
